<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" import="com.zzty.springmybatis.entity.User"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<meta charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ZZTY</title>
<!-- BOOTSTRAP STYLES-->
<!-- CUSTOM STYLES-->

<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script
	src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="/SpringMVCMybatis/css/bootstrap-datetimepicker.css"
	rel="stylesheet" />
<link href="/SpringMVCMybatis/css/bootstrap.css" rel="stylesheet" />
<link href="/SpringMVCMybatis/css/bootstrap.min.css" rel="stylesheet" />
<link href="/SpringMVCMybatis/css/custom.css" rel="stylesheet" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
<%-- <%User user = (User) request.getSession().getAttribute("user"); --%>
<%-- 			String img = (String) user.getImg();%> --%>
$(document).ready(function() {
	$("#searchbydate").click(function() {
		$("#tablebody").empty();

		$.ajax({
			type : "POST",
			url : "teamgread/Call",
			//dataType : "json",
			contentType : "application/json",
			data : JSON.stringify({
				date : $("#targetdate").val()
			}),
			success : function(data) {
				if (date == "") {
					alert("请输入正确语句");
				} else {
					var obj = JSON.parse(data);
	 				for (i in obj) {
	 					var x = "<tr>";
	 						x = x + "<td>" + obj[i].stuIds + "</td><td>" + obj[i].stuNames + "</td><td>" + obj[i].totalTime + "</td><td>" + obj[i].score + "</td>";
	 						x = x + "<td><button class = 'details' >详情</button></td></tr>";
	 					$("#tablebody").append(x);
	 				}
	 				$("#tarea1").val( obj[0].qstContent);
				}
			},
			error : function(data) {
				alert("查询失败");
			}
		});
		
	})
		
	$(document).on("click",".details",function(){
		var date = $("#targetdate").val();
		var id = $(this).parent().parent().children().eq(0).html();
		window.open("StudentAnswer.jsp?id=" + id + "&date=" + date
				+ "&operation=teamExam");
		})

})
</script>
<body>

	<div id="wrapper">
		<nav class="navbar navbar-default navbar-cls-top " role="navigation"
			style="margin-bottom: 0">
			<div class="navbar-header">
				<!--                 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse"> -->
				<!--                     <span class="sr-only">Toggle navigation</span> -->
				<!--                     <span class="icon-bar"></span> -->
				<!--                     <span class="icon-bar"></span> -->
				<!--                     <span class="icon-bar"></span> -->
				<!--                 </button> -->
				<a class="navbar-brand">自在天原</a>
			</div>
			<div
				style="color: white; padding: 15px 50px 5px 50px; float: right; font-size: 16px;">
				<form action="../loginOut.jsp" method="post">
					<button type="submit" class="btn btn-danger">注销</ button>
					
				</form>
			</div>
		</nav>
		<!-- /. NAV TOP  -->
		<nav class="navbar-default navbar-side" role="navigation">
			<div class="sidebar-collapse">
				<ul class="nav" id="main-menu">
					<li class="text-center"><img src=" "
						class="user-image img-responsive" /></li>


					<li><a href="../SpringMVCMybatis/selfgread"><i
							class="fa fa-desktop fa-3x"></i> 竞赛批改</a></li>
					<li><a href="../SpringMVCMybatis/teamgread"><i
							class="fa fa-qrcode fa-3x"></i> 结对批改</a></li>
					<li><a href="../SpringMVCMybatis/que/AssginTask"><i
							class="fa fa-bar-chart-o fa-3x"></i> 竞赛布置</a></li>
					<li><a href="../SpringMVCMybatis/group/group"><i
							class="fa fa-bar-chart-o fa-3x"></i> 结对分组</a></li>
					<li><a href="../SpringMVCMybatis/SearchScore/toSearch"><i
							class="fa fa-bar-chart-o fa-3x"></i> 学生成绩</a></li>
					<li><a href="../SpringMVCMybatis/Data"><i
							class="fa fa-bar-chart-o fa-3x"></i> 数据库查询</a></li>
				</ul>

			</div>

		</nav>
		<!-- /. NAV SIDE  -->
		<div id="page-wrapper">
			<div id="page-inner">
				<div class="row">
					<div class="col-md-12">
						<h2>结对作业评分</h2>
					</div>
				</div>
				<!-- /. ROW  -->
				<hr />

				<div class="col-sm-offset-10 col-sm-2">
					<input id="date" style="background: transparent; border: none;"
						disabled="true"font-size:50px;"></input>
				</div>

				<div class="row" style="padding: 50px 0px 0px 0px">
					<div class="col-sm-offset-4 col-sm-8">
						请选择日期：<input type="date" id="targetdate" /> <input type="button"
							class="btn btn-primary" id="searchbydate" value="查找" />
					</div>
				</div>
				<div class="row">
					<div class="col-sm-offset-3 col-sm-9"
						style="padding: 50px 20px 0px 20px">
						<textarea id="tarea1" rows="15" cols="60"
							style="background: transparent" disabled="true"></textarea>
					</div>
				</div>
				<div class="row" style="padding: 50px 20px 0px 20px">

					<div class="table-responsive">
						<table class="table table-striped" id="table1"
							style="text-align: center">
							<thead>
								<tr>
									<th style="text-align: center">组员ID</th>
									<th style="text-align: center">组员</th>
									<th style="text-align: center">用时(min)</th>
									<th style="text-align: center">评分</th>
									<th style="text-align: center">进行评价</th>
								</tr>
							</thead>

							<tbody id="tablebody">


							</tbody>
						</table>

					</div>
				</div>

			</div>
		</div>
		<!-- /. PAGE INNER  -->
	</div>
</body>
</html>
